function Transaction() {

	this.id = null;
	this.date = new Date();
	this.approved = true;
	this.srcAccId = null;
	this.srcSum = null;
	this.srcCurId = null;
	this.dstAccId = null;
	this.dstSum = null;
	this.dstCurId = null;
	this.profit = null;
	this.categoryId = null;
	this.tags = [];
	this.desc = '';

	this.fromJson = function(json) {
		this.id = parseInt(json.id);
		this.date = new Date(json.date);
		this.approved = json.approved;
		this.srcAccId = json.srcAccId;
		this.srcSum = json.srcSum;
		this.srcCurId = json.srcCurId;
		this.dstAccId = json.dstAccId;
		this.dstSum = json.dstSum;
		this.dstCurId = json.dstCurId;
		this.profit = json.profit;
		this.categoryId = json.categoryId;
		this.tags = json.tags;
		this.desc = json.desc;
		return this;
	};

	this.clone = function () {
		var tr = new Transaction();
		tr.id = this.id;
		tr.date = new Date(this.date);
		tr.approved = this.approved;
		tr.srcAccId = this.srcAccId;
		tr.srcSum = this.srcSum;
		tr.srcCurId = this.srcCurId;
		tr.dstAccId = this.dstAccId;
		tr.dstSum = this.dstSum;
		tr.dstCurId = this.dstCurId;
		tr.profit = this.profit;
		tr.categoryId = this.categoryId;
		tr.tags = [];
		$.merge(tr.tags, this.tags);
		tr.desc = this.desc;
		return tr;
	};
};